/****************************************************************************

Tallulah - Projeto LES

****************************************************************************/

#ifndef MDICHILD_H
#define MDICHILD_H

#define MAX 100

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QGroupBox>
#include <QComboBox>
#include <QSpinBox>
#include <QScrollArea>
#include <QList>

#include "query.h"


class MdiChild : public QWidget
{
    Q_OBJECT

public:

	int qt;
	QScrollArea *scrollArea;
	QWidget *scrollAreaWidgetContents;
	QVBoxLayout* layout;
	QVBoxLayout* formLay;

	QList<query*> queryList;

	QWidget* botoes;
	QHBoxLayout* botLay;
	QPushButton* add;
	QPushButton* del;

    MdiChild();

    void newFile();
    void novaPergunta(int n);
    bool loadFile(const QString &fileName);
	void cut(){}
	void copy(){}
	void paste(){}
    QString filename();
    QString newFilename();
    QList<query*>& getQueryList();
    bool saveFile(const QString &fileName);
    QString userFriendlyCurrentFile();
    QString currentFile() { return curFile; }

protected:
    void closeEvent(QCloseEvent *event);

private slots:
    void documentWasModified();

private:
	int quant;
    bool maybeSave();
    void setCurrentFile(const QString &fileName);
    QString strippedName(const QString &fullFileName);

    QString curFile;
    bool isUntitled;

public slots:
	void adicionar();
	void remover();
	void monitoraSelecao();
};

#endif
